<?php

class View_Helper_MenuHelper extends Model3_View_Helper
{
    private $_cr;

    public function display()
    {
        if (Model3_Auth::isAuth())
        {
            $this->_cr = Model3_Auth::getCredentials();
            $dbs = Model3_Registry::getInstance()->get('databases');
            $em = $dbs['DefaultDb'];
            $user = $em->find('DefaultDb_Entities_User', $this->_cr['id']);
            switch ($this->_cr['type'])
            {
                case DefaultDb_Entities_User::USER_ADMIN :
                    $this->displayMenuAdmin();
                    break;
                case DefaultDb_Entities_User::USER_DRIVER:
                    $this->displayMenuDriver();
                    break;
                case DefaultDb_Entities_User::USER_CLIENT:
                    $this->displayMenuClient();
                    break;
                default:
                    Model3_Auth::deleteCredentials();
                    $this->displayMenuNone();
                    break;
            }
        }
        else
        {
            $this->displayMenuNone();
        }
    }

    public function displayResponsive()
    {
        if (Model3_Auth::isAuth())
        {
            $this->_cr = Model3_Auth::getCredentials();
            $dbs = Model3_Registry::getInstance()->get('databases');
            $em = $dbs['DefaultDb'];
            $user = $em->find('DefaultDb_Entities_User', $this->_cr['id']);
            switch ($this->_cr['type'])
            {
                case DefaultDb_Entities_User::USER_ADMIN :
                    $this->displayMenuAdminResponsive();
                    break;
                case DefaultDb_Entities_User::USER_DRIVER:
                    $this->displayMenuDriver();
                    break;
                case DefaultDb_Entities_User::USER_CLIENT:
                    $this->displayMenuClient();
                    break;
                case DefaultDb_Entities_User::USER_STORER:
                    $this->displayMenuStorerResponsive();
                    break;
                case DefaultDb_Entities_User::USER_OPERATION_CONTROLLER:
                    $this->displayMenuOperationControllerResponsive();
                    break;
                default:
                    Model3_Auth::deleteCredentials();
                    $this->displayMenuNone();
                    break;
            }
        }
        else
        {
            $this->displayMenuNone();
        }
    }

    private function printLogOut($cr)
    {
        ?>
        <ul class="nav pull-right">
            <li><a>Usuario: <?php echo $cr['username']; ?></a></li>
            <li><a href="#" title="cerrar sesion" id="sessionExit"><i class="icon-off icon-white" ></i> Salir</a></li>
        </ul>
        <?php
    }

    private function printLogOutResponsive($cr)
    {
        ?>
        <ul class="nav navbar-nav pull-right">
            <li><a>Usuario: <?php echo $cr['username']; ?></a></li>
            <li><a href="#" title="cerrar sesion" id="sessionExit"><i class="icon-off icon-white" ></i> Salir</a></li>
        </ul>
        <?php
    }

    private function displayMenuAdmin()
    {
        ?>
        <div class="navbar">
            <div class="navbar-inner">
                <div class="container">
                    <div class="nav-collapse">
                        <ul class="nav">
                            <li><a href="<?php
                                echo $this->_view->url(array(
                                    'module' => 'Admin',
                                    'controller' => 'Dashboard',
                                    'action' => 'index'))
                                ?>" ><?php echo ($this->_view->TrHelper()->_('Inicio')); ?></a> </li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $this->_view->TrHelper()->_('Tiendas'); ?> <b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                    <!--<li><a href="<?php // echo $this->_view->url(array('module' => 'Admin', 'controller' => 'PackagesTypes', 'action' => 'index'))                                  ?>" ><?php // echo $this->_view->TrHelper()->_('Paquetes');                                  ?></a></li>-->
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'Admin',
                                            'controller' => 'Categories',
                                            'action' => 'index'))
                                        ?>" ><?php echo $this->_view->TrHelper()->_('Categorias'); ?></a></li>
                                    <li class="divider"></li>
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'Admin',
                                            'controller' => 'Reports',
                                            'action' => 'orders'))
                                        ?>" ><?php echo $this->_view->TrHelper()->_('Ordenes'); ?></a></li>
                                </ul>
                            </li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $this->_view->TrHelper()->_('Rutas'); ?><b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'Admin',
                                            'controller' => 'Routes',
                                            'action' => 'index'))
                                        ?>" ><?php echo $this->_view->TrHelper()->_('Rutas'); ?></a></li>
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'Admin',
                                            'controller' => 'Calendar',
                                            'action' => 'index'))
                                        ?>" ><?php echo $this->_view->TrHelper()->_('Calendario'); ?></a></li>
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'Admin',
                                            'controller' => 'Program',
                                            'action' => 'index'))
                                        ?>" ><?php echo $this->_view->TrHelper()->_('Programación'); ?></a></li>
                                    <li class="divider"></li>
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'Admin',
                                            'controller' => 'Reports',
                                            'action' => 'secuencialActivity'))
                                        ?>" ><?php echo $this->_view->TrHelper()->_('Reporte de Actividades'); ?></a></li>
                                </ul>
                            </li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $this->_view->TrHelper()->_('Sistema'); ?><b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'Admin',
                                            'controller' => 'Vehicles',
                                            'action' => 'index'))
                                        ?>" ><?php echo $this->_view->TrHelper()->_('Vehículos'); ?></a></li>
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'Admin',
                                            'controller' => 'AdminUsers',
                                            'action' => 'index'))
                                        ?>" ><?php echo $this->_view->TrHelper()->_('Usuarios'); ?></a></li>
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'Storer',
                                            'controller' => 'Admin',
                                            'action' => 'users'))
                                        ?>" ><?php echo $this->_view->TrHelper()->_('Almacenistas'); ?></a></li>
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'Admin',
                                            'controller' => 'InvoicesUsers',
                                            'action' => 'index'))
                                        ?>" ><?php echo $this->_view->TrHelper()->_('Facturacion'); ?></a></li>
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'Admin',
                                            'controller' => 'Email',
                                            'action' => 'index'))
                                        ?>" ><?php echo $this->_view->TrHelper()->_('Correos'); ?></a></li>
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'Admin',
                                            'controller' => 'ConfigSystem',
                                            'action' => 'index'))
                                        ?>" ><?php echo $this->_view->TrHelper()->_('Configuracion'); ?></a></li>
                                </ul>
                            </li>
                        </ul>
                        <?php $this->printLogOut($this->_cr); ?>
                    </div>
                </div>
            </div>
        </div>
        <?php
    }

    private function displayMenuStorerResponsive()
    {
        ?>
        <div class="navbar navbar-default navbar-fixed-top" style="margin-bottom: 0px;">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                </div>
                <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        <li>
                            <a href="<?php
                            echo $this->_view->url(array(
                                'module' => 'Storer',
                                'controller' => 'Dashboard',
                                'action' => 'index'))
                            ?>" >
                                   <?php echo ($this->_view->TrHelper()->_('Inicio')); ?>
                            </a> 
                        </li>
                    </ul>
                    <?php $this->printLogOutResponsive($this->_cr); ?>
                </div>
            </div>
        </div>
        <?php
    }

    private function displayMenuOperationControllerResponsive()
    {
        ?>
        <div class="navbar navbar-default navbar-fixed-top" style="margin-bottom: 0px;">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                </div>
                <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        <li>
                            <a href="<?php
                            echo $this->_view->url(array(
                                'controller' => 'Dashboard',
                                'action' => 'index',))
                            ?>">
                                   <?php echo ($this->_view->TrHelper()->_('Inicio')); ?>
                            </a> 
                        </li>
                        <?php $session = new Model3_Session_Namespace('operationController'); ?>
                        <?php if ($session->required === true) : ?>
                            <li class="dropdown">
                                <a class="dropdown-toggle" data-toggle="dropdown" href="<?php
                                echo $this->_view->url(array(
                                    'controller' => 'Dashboard',
                                    'action' => 'resources',))
                                ?>" >
                                       <?php echo ($this->_view->TrHelper()->_('Recursos')); ?>
                                    <b class="caret"></b>
                                </a> 
                                <ul class="dropdown-menu">
                                    <?php
                                    $driversPath = $this->_view->url(array('module' => 'OperationController',
                                        'controller' => 'Dashboard', 'action' => 'drivers'));
                                    $vehiclesPath = $this->_view->url(array('module' => 'OperationController',
                                        'controller' => 'Dashboard', 'action' => 'vehicles'));
                                    $routesPath = $this->_view->url(array('module' => 'OperationController',
                                        'controller' => 'Dashboard', 'action' => 'routes'));
                                    ?>
                                    <li><a href="<?php echo $driversPath; ?>">Conductores</a></li>
                                    <li><a href="<?php echo $vehiclesPath; ?>">Vehículos</a></li>
                                    <li><a href="<?php echo $routesPath; ?>">Rutas</a></li>
                                </ul>
                            </li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $this->_view->TrHelper()->_('Rutas'); ?><b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'Admin',
                                            'controller' => 'Routes',
                                            'action' => 'index'))
                                        ?>" ><?php echo $this->_view->TrHelper()->_('Rutas'); ?></a></li>
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'Admin',
                                            'controller' => 'Calendar',
                                            'action' => 'index'))
                                        ?>" ><?php echo $this->_view->TrHelper()->_('Calendario'); ?></a></li>
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'Admin',
                                            'controller' => 'Program',
                                            'action' => 'index'))
                                        ?>" ><?php echo $this->_view->TrHelper()->_('Programación'); ?></a></li>
                                    <li class="divider"></li>
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'Admin',
                                            'controller' => 'Reports',
                                            'action' => 'secuencialActivity'))
                                        ?>" ><?php echo $this->_view->TrHelper()->_('Reporte de Actividades'); ?></a></li>
                                </ul>
                            </li>
                            <li>
                                <a href="<?php
                                echo $this->_view->url(array(
                                    'module' => 'OperationController',
                                    'controller' => 'Dashboard',
                                    'action' => 'evalUser',))
                                ?>">
                                       <?php echo ($this->_view->TrHelper()->_('Evaluación de personal')); ?>
                                </a> 
                            </li>
                        <?php endif; ?>
                    </ul>
                    <?php $this->printLogOutResponsive($this->_cr); ?>
                </div>
            </div>
        </div>
        <?php
    }

    private function displayMenuAdminResponsive()
    {
        ?>
        <div class="navbar navbar-default navbar-fixed-top" style="margin-bottom: 0px;">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <!--                    <a class="navbar-brand" href="#">
                                            <img src="<?php echo $this->_view->getBaseUrl('/images/logo-masfletes.gif'); ?>" />
                                        </a>-->
                </div>
                <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        <li>
                            <a href="<?php
                            echo $this->_view->url(array(
                                'module' => 'Admin',
                                'controller' => 'Dashboard',
                                'action' => 'index'))
                            ?>" >
                                   <?php echo ($this->_view->TrHelper()->_('Inicio')); ?>
                            </a> 
                        </li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $this->_view->TrHelper()->_('Tiendas'); ?> <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <!--<li><a href="<?php // echo $this->_view->url(array('module' => 'Admin', 'controller' => 'PackagesTypes', 'action' => 'index'))                                 ?>" ><?php // echo $this->_view->TrHelper()->_('Paquetes');                                 ?></a></li>-->
                                <li><a href="<?php
                                    echo $this->_view->url(array(
                                        'module' => 'Admin',
                                        'controller' => 'Categories',
                                        'action' => 'index'))
                                    ?>" ><?php echo $this->_view->TrHelper()->_('Categorias'); ?></a></li>
                                <li class="divider"></li>
                                <li><a href="<?php
                                    echo $this->_view->url(array(
                                        'module' => 'Admin',
                                        'controller' => 'Reports',
                                        'action' => 'orders'))
                                    ?>" ><?php echo $this->_view->TrHelper()->_('Ordenes'); ?></a></li>
                            </ul>
                        </li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $this->_view->TrHelper()->_('Rutas'); ?><b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li><a href="<?php
                                    echo $this->_view->url(array(
                                        'module' => 'Admin',
                                        'controller' => 'Routes',
                                        'action' => 'index'))
                                    ?>" ><?php echo $this->_view->TrHelper()->_('Rutas'); ?></a></li>
                                <li><a href="<?php
                                    echo $this->_view->url(array(
                                        'module' => 'Admin',
                                        'controller' => 'ExchangeCenters',
                                        'action' => 'index'))
                                    ?>" ><?php echo $this->_view->TrHelper()->_('Centros de intercambio'); ?></a></li>
                                <li><a href="<?php
                                    echo $this->_view->url(array(
                                        'module' => 'Admin',
                                        'controller' => 'Calendar',
                                        'action' => 'index'))
                                    ?>" ><?php echo $this->_view->TrHelper()->_('Calendario'); ?></a></li>
                                <li><a href="<?php
                                    echo $this->_view->url(array(
                                        'module' => 'Admin',
                                        'controller' => 'Program',
                                        'action' => 'index'))
                                    ?>" ><?php echo $this->_view->TrHelper()->_('Programación'); ?></a></li>
                                <li class="divider"></li>
                                <li><a href="<?php
                                    echo $this->_view->url(array(
                                        'module' => 'Admin',
                                        'controller' => 'Reports',
                                        'action' => 'secuencialActivity'))
                                    ?>" ><?php echo $this->_view->TrHelper()->_('Reporte de Actividades'); ?></a></li>
                            </ul>
                        </li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $this->_view->TrHelper()->_('Sistema'); ?><b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li><a href="<?php
                                    echo $this->_view->url(array(
                                        'module' => 'Admin',
                                        'controller' => 'Vehicles',
                                        'action' => 'index'))
                                    ?>" ><?php echo $this->_view->TrHelper()->_('Vehículos'); ?></a></li>
                                <li><a href="<?php
                                    echo $this->_view->url(array(
                                        'module' => 'Admin',
                                        'controller' => 'AdminUsers',
                                        'action' => 'index'))
                                    ?>" ><?php echo $this->_view->TrHelper()->_('Usuarios'); ?></a></li>
                                <li><a href="<?php
                                    echo $this->_view->url(array(
                                        'module' => 'Storer',
                                        'controller' => 'Admin',
                                        'action' => 'users'))
                                    ?>" ><?php echo $this->_view->TrHelper()->_('Almacenistas'); ?></a></li>
                                <li><a href="<?php
                                    echo $this->_view->url(array(
                                        'module' => 'Admin',
                                        'controller' => 'InvoicesUsers',
                                        'action' => 'index'))
                                    ?>" ><?php echo $this->_view->TrHelper()->_('Facturacion'); ?></a></li>
                                <li><a href="<?php
                                    echo $this->_view->url(array(
                                        'module' => 'Admin',
                                        'controller' => 'Email',
                                        'action' => 'index'))
                                    ?>" ><?php echo $this->_view->TrHelper()->_('Correos'); ?></a></li>
                                <li><a href="<?php
                                    echo $this->_view->url(array(
                                        'module' => 'Admin',
                                        'controller' => 'ConfigSystem',
                                        'action' => 'index'))
                                    ?>" ><?php echo $this->_view->TrHelper()->_('Configuracion'); ?></a></li>
                            </ul>
                        </li>
                    </ul>
                    <?php $this->printLogOutResponsive($this->_cr); ?>
                    <!--                    <ul class="nav navbar-nav navbar-right">
                                            <li>
                                                <a title="Panel para ingreso de usuarios" href="<?php
                    echo
                    $this->_view->url(array(
                        'controller' => 'Sesion', 'action' => 'Index'));
                    ?>">
                                                    Iniciar sesión
                                                </a>
                                            </li>
                                        </ul>-->
                </div>
            </div>
        </div>

        <!--        <div class="navbar">
                    <div class="navbar-inner">
                        <div class="container">
                            <div class="nav-collapse">
                                <ul class="nav">
                                    <li><a href="<?php
        echo $this->_view->url(array(
            'module' => 'Admin',
            'controller' => 'Dashboard',
            'action' => 'index'))
        ?>" ><?php echo ($this->_view->TrHelper()->_('Inicio')); ?></a> </li>
                                    <li class="dropdown">
                                        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $this->_view->TrHelper()->_('Tiendas'); ?> <b class="caret"></b></a>
                                        <ul class="dropdown-menu">
                                            <li><a href="<?php // echo $this->_view->url(array('module' => 'Admin', 'controller' => 'PackagesTypes', 'action' => 'index'))                                 ?>" ><?php // echo $this->_view->TrHelper()->_('Paquetes');                                 ?></a></li>
                                            <li><a href="<?php
        echo $this->_view->url(array(
            'module' => 'Admin',
            'controller' => 'Categories',
            'action' => 'index'))
        ?>" ><?php echo $this->_view->TrHelper()->_('Categorias'); ?></a></li>
                                            <li class="divider"></li>
                                            <li><a href="<?php
        echo $this->_view->url(array(
            'module' => 'Admin',
            'controller' => 'Reports',
            'action' => 'orders'))
        ?>" ><?php echo $this->_view->TrHelper()->_('Ordenes'); ?></a></li>
                                        </ul>
                                    </li>
                                    <li class="dropdown">
                                        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $this->_view->TrHelper()->_('Rutas'); ?><b class="caret"></b></a>
                                        <ul class="dropdown-menu">
                                            <li><a href="<?php
        echo $this->_view->url(array(
            'module' => 'Admin',
            'controller' => 'Routes',
            'action' => 'index'))
        ?>" ><?php echo $this->_view->TrHelper()->_('Rutas'); ?></a></li>
                                            <li><a href="<?php
        echo $this->_view->url(array(
            'module' => 'Admin',
            'controller' => 'Calendar',
            'action' => 'index'))
        ?>" ><?php echo $this->_view->TrHelper()->_('Calendario'); ?></a></li>
                                            <li><a href="<?php
        echo $this->_view->url(array(
            'module' => 'Admin',
            'controller' => 'Program',
            'action' => 'index'))
        ?>" ><?php echo $this->_view->TrHelper()->_('Programación'); ?></a></li>
                                            <li class="divider"></li>
                                            <li><a href="<?php
        echo $this->_view->url(array(
            'module' => 'Admin',
            'controller' => 'Reports',
            'action' => 'secuencialActivity'))
        ?>" ><?php echo $this->_view->TrHelper()->_('Reporte de Actividades'); ?></a></li>
                                        </ul>
                                    </li>
                                    <li class="dropdown">
                                        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $this->_view->TrHelper()->_('Sistema'); ?><b class="caret"></b></a>
                                        <ul class="dropdown-menu">
                                            <li><a href="<?php
        echo $this->_view->url(array(
            'module' => 'Admin',
            'controller' => 'Vehicles',
            'action' => 'index'))
        ?>" ><?php echo $this->_view->TrHelper()->_('Vehículos'); ?></a></li>
                                            <li><a href="<?php
        echo $this->_view->url(array(
            'module' => 'Admin',
            'controller' => 'AdminUsers',
            'action' => 'index'))
        ?>" ><?php echo $this->_view->TrHelper()->_('Usuarios'); ?></a></li>
                                            <li><a href="<?php
        echo $this->_view->url(array(
            'module' => 'Admin',
            'controller' => 'InvoicesUsers',
            'action' => 'index'))
        ?>" ><?php echo $this->_view->TrHelper()->_('Facturacion'); ?></a></li>
                                            <li><a href="<?php
        echo $this->_view->url(array(
            'module' => 'Admin',
            'controller' => 'Email',
            'action' => 'index'))
        ?>" ><?php echo $this->_view->TrHelper()->_('Correos'); ?></a></li>
                                            <li><a href="<?php
        echo $this->_view->url(array(
            'module' => 'Admin',
            'controller' => 'ConfigSystem',
            'action' => 'index'))
        ?>" ><?php echo $this->_view->TrHelper()->_('Configuracion'); ?></a></li>
                                        </ul>
                                    </li>
                                </ul>
        <?php $this->printLogOut($this->_cr); ?>
                            </div>
                        </div>
                    </div>
                </div>-->
        <?php
    }

    private function displayMenuClient()
    {
        ?>
        <div class="navbar">
            <div class="navbar-inner">
                <div class="container">
                    <div class="nav-collapse">
                        <ul class="nav">
                            <li><a href="<?php
                                echo $this->_view->url(array(
                                    'module' => 'User',
                                    'controller' => 'Dashboard',
                                    'action' => 'index'))
                                ?>" ><i class="icon-home icon-white"></i><?php echo ($this->_view->TrHelper()->_('Inicio')); ?></a> </li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-th-list icon-white"></i><?php echo $this->_view->TrHelper()->_('Mi panel'); ?> <b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'User',
                                            'controller' => 'Catalogos',
                                            'action' => 'index'))
                                        ?>" ><i class="icon-book"></i><?php echo $this->_view->TrHelper()->_('Catalogos'); ?></a></li>
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'User',
                                            'controller' => 'InvoicesUsers',
                                            'action' => 'index'))
                                        ?>" ><i class="icon-book"></i><?php echo $this->_view->TrHelper()->_('Facturacion'); ?></a></li>
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'User',
                                            'controller' => 'BackStore',
                                            'action' => 'orders'))
                                        ?>" ><i class="icon-folder-close"></i><?php echo $this->_view->TrHelper()->_('Ventas'); ?></a></li>
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'User',
                                            'controller' => 'BackStore',
                                            'action' => 'shopping'))
                                        ?>" ><i class="icon-lock"></i><?php echo $this->_view->TrHelper()->_('Compras'); ?></a></li>
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'User',
                                            'controller' => 'BranchesUser',
                                            'action' => 'index'))
                                        ?>" ><i class="icon-lock"></i><?php echo $this->_view->TrHelper()->_('Sucursales'); ?></a></li>
                                    <li class="divider"></li>

                                </ul>
                            </li>
                            <li><a href="<?php
                                echo $this->_view->url(array(
                                    'module' => 'User',
                                    'controller' => 'Store',
                                    'action' => 'index'))
                                ?>" ><i class="icon-tags icon-white"></i><?php echo $this->_view->TrHelper()->_('Tiendas'); ?></a></li>
                            <li><a href="<?php
                                echo $this->_view->url(array(
                                    'module' => 'User',
                                    'controller' => 'Store',
                                    'action' => 'viewCart'))
                                ?>" ><i class="icon-shopping-cart icon-white"></i><?php echo $this->_view->TrHelper()->_('Carrito'); ?></a></li>
                            <li><a href="<?php
                                echo $this->_view->url(array(
                                    'module' => 'User',
                                    'controller' => 'FavoriteUsers',
                                    'action' => 'index'))
                                ?>" ><i class="icon-star icon-white"></i><?php echo $this->_view->TrHelper()->_('Favoritos'); ?></a></li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $this->_view->TrHelper()->_($this->_cr['username']); ?><b class="caret"></b></a>
                                <ul class="dropdown-menu" nav pull-right>
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'User',
                                            'controller' => 'UserProfile',
                                            'action' => 'index'))
                                        ?>" ><?php echo $this->_view->TrHelper()->_('Datos Personales'); ?></a></li>
                                    <li><a href="<?php
                                        echo $this->_view->url(array(
                                            'module' => 'User',
                                            'controller' => 'UserProfile',
                                            'action' => 'password'))
                                        ?>" ><?php echo $this->_view->TrHelper()->_('Passsword'); ?></a></li>
                                    <li><a href="#" id="sessionExit"><?php echo $this->_view->TrHelper()->_('Salir'); ?></a></li>
                                </ul>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <?php
    }

    private function displayMenuDriver()
    {
        ?>
        <div class="navbar row-fluid">
            <div class="span12">
                <!--<div class="nav-collapse">-->
                <ul class="nav">
                    <li>
                        <a href="<?php
                        echo $this->_view->url(array(
                            'module' => 'Driver',
                            'controller' => 'Dashboard',
                            'action' => 'index'))
                        ?>" ><?php echo ($this->_view->TrHelper()->_('Inicio')); ?>
                        </a> 
                    </li>
                </ul>
                <?php $this->printLogOut($this->_cr); ?>
                <!--</div>-->
            </div>
        </div>
        <?php
    }

    private function displayMenuNone()
    {
        ?>
        <div class="navbar ">
            <div class="navbar-inner">
                <div class="container">
                    <ul class="nav">
                        <li><a href="<?php
                            echo $this->_view->url(array(
                                'module' => false,
                                'controller' => 'Index',
                                'action' => 'index'))
                            ?>" ><?php echo ($this->_view->TrHelper()->_('Inicio
                                           

                                                           

                                           

                                 

                                 ')); ?></a> </li>
                    </ul>
                </div>
            </div>
        </div>
        <?php
    }

}
